<template>
	<view>
		<!-- 操作菜单 -->
		<view class="paper-left-popup-mask" v-show="show" @tap='hidePopup'></view>
			<view class="paper-left-popup" v-show="show">
				<view class="u-f-ac" hover-class="paper-left-popup-h" @tap='handleAddFriend'>
					<view class="icon iconfont icon-sousuo"></view>加糗友
				</view>
				<view class="u-f-ac" hover-class="paper-left-popup-h" @tap='handleClearStorage'>
					<view class="icon iconfont icon-qingchu"></view>清除缓存
				</view>
			</view>
	</view>
</template>

<script>
	export default {
		props:{
			show: Boolean
		},
		methods:{
			// 点击操作单清除缓存
			handleClearStorage(){
				this.$emit('clear')
			},
			// 关闭操作单和遮罩层
			hidePopup() {
				this.$emit('hide')
			},
			// 点击操作单添加好友
			handleAddFriend() {
				this.$emit('addfriend')
			},
		}
	}
</script>

<style scoped>
	.paper-left-popup-mask {
		position: fixed;
		top: 0;
		bottom: 0;
		left: 0;
		right: 0;
		z-index: 1999;
	}
	.paper-left-popup {
		position: fixed;
		right: 0;
		/* app端10upx */
		/* h5 100upx */
		top: 100upx;
		background-color: #FFFFFF;
		z-index: 2000;
		width: 55%;
		box-shadow: 1upx 1upx 20upx 2upx #CCCCCC;
	}
	
	.paper-left-popup>view {
		padding: 20upx;
		font-size: 35upx;
	}
	.paper-left-popup>view>view {
		margin-right: 10upx;
		font-weight: 700;
	}
	
	.paper-left-popup-h {
		background-color: #eee;
	}
</style>
